<% if @website_user.new_record? -%>
<h1><%= "New Website User"[:new_website_user] %></h1>
<% else -%>
<h1><%= "Edit Website User"[:edit_website_user] %></h1>
<% end -%>

<form method="post">
  <table class="fieldset" cellpadding="0" cellspacing="0" border="0">
    <tr>
      <td class="label"><label for="website_user_email"><%= "E-mail"[:email] %></label></td>
      <td class="field"><%= text_field "website_user", "email", :class => 'textbox', :maxlength => 255 %></td>
      <td class="help"><%= "Required"[:required] %> <%= "Please use a valid e-mail address"[:please_use_a_valid_email_address] %>.</td>
    </tr>
    <tr>
      <td class="label"><label for="website_user_nickname"><%= "Nickname"[:nickname] %></label></td>
      <td class="field"><%= text_field "website_user", "nickname", :class => 'textbox', :maxlength => 40 %></td>
      <td class="help"></td>
    </tr>
    <tr>
      <td class="label"><label class="optional" for="website_user_name"><%= "Name"[:name] %></label></td>
      <td class="field"><%= text_field "website_user", "name", :class => 'textbox', :maxlength => 100 %></td>
      <td class="help"><%= "Optional"[:optional] %></td>
    </tr>
    <tr>
      <td class="label"><label class="optional" for="website_user_password"><%= "Password"[:password] %></label></td>
      <td class="field"><%= password_field "website_user", "password", :class => 'textbox', :value => '', :maxlength => 40 %></td>
      <td class="help" rowspan="2">
				<%= "At least 6 characters."[:at_least_5_characters] %> <% unless @website_user.new_record? %><%= "Leave password blank for it to remain unchanged."[:leave_password_blank_for_it_to_remain_unchanged] %><% end %>
				<%= link_to "Send a new random password"[:new_random_password], website_user_new_password_url(@website_user), :confirm => "Are you sure?"[:are_you_sure] %>
			</td>
    </tr>
    <tr>
      <td class="label"><label class="optional" for="user_password_confirmation"><%= "Confirm Password"[:confirm_password] %></label></td>
      <td class="field"><%= password_field "website_user", "password_confirmation", :class => 'textbox', :value => '', :maxlength => 40 %></td>
    </tr>
    <tr>
      <td class="label"><label for="website_user_active"><%= "Active"[:active] %></label></td>
      <td class="field">
        <span class="checkbox"><%= check_box "website_user", "active" %>&nbsp;<%= "User is active"[:user_is_active] %></span>
      </td>
      <td class="help"><%= "Check the box to enable the login ability of this user"[:check_the_box_to_enable_the_login_ability_of_this_user] %></td>
    </tr>
    <tr>
      <td class="label"><label class="optional" for="website_user_end_date"><%= "Active until"[:active_until] %></label></td>
      <td class="field">
        <%= text_field "website_user", "end_date", :class => 'textbox', :maxlength => 100 %>
      </td>
      <td class="help"><%= "Fill this field if this account should be disabled after a certain date. Format: yyyy-mm-dd."[:fill_field_for_active_until] %></td>
    </tr>
    <tr>
      <td class="label"><label class="optional" for="user_notes"><%= "Notes"[:notes] %></label></td>
      <td class="field"><%= text_area "website_user", "notes", :size => '40x4' %></td>
      <td class="help"><%= "Optional"[:optional] %></td>
    </tr>
  </table>
  <p class="buttons">
    <%= save_model_button(@website_user) %> <%= save_model_and_continue_editing_button(@website_user) %> <%= "or"[:or] %> <%= link_to "Cancel"[:cancel], website_user_index_url %>
  </p>
</form>

<%= focus 'website_user_email' %>